/**
 * 
 */
package org.william.common_boot.bootjpa.control;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.william.common_boot.bootjpa.domain.JpaCityBean;
import org.william.common_boot.bootjpa.service.JPACityService;

/**
 * 
 * Description: 
 * @author xuhongwei
 * @version 1.0
 * <pre>
 * Modification History: 
 * Date         Author      Version     Description 
------------------------------------------------------------------
 * 2018年9月4日   	 xhw         1.0 	Version 
 * </pre>
 */
@RestController
@RequestMapping("/jpaCityControl")
public class JpaCityControl {
	
	@Autowired
	JPACityService jPACityService ;
	
	@RequestMapping(value="/saveCity",method={RequestMethod.GET,RequestMethod.POST})
	public void getCityMaster(){
		
		jPACityService.save(new JpaCityBean("大连222"));
		
	}
	
	@RequestMapping(value="/saveCity1",method={RequestMethod.GET,RequestMethod.POST})
	public void getCitySlave(){
		
		jPACityService.save1(new JpaCityBean("大连1233"));
		
	}
	
	@RequestMapping(value="/queryOneOfCity",method={RequestMethod.GET,RequestMethod.POST})
	public Object queryOneOfCity(int cityId){
		return jPACityService.findById(cityId);
				
	}
}
